from selenium import webdriver
from selenium.webdriver.common.by import By



driver=webdriver.Chrome()
driver.get("http://192.168.46.5:18089/login")
driver.implicitly_wait(3)

driver.find_element(By.NAME,"username").send_keys("XTGLY")
driver.find_element(By.NAME,"password").send_keys("123456")
driver.find_element(By.NAME,"signIn").click()

driver.find_element(By.LINK_TEXT,'客户信息').click()

# 定位第一条信息的查看按钮；
a=driver.find_element(By.XPATH,'//*[@id="app"]/div/div[2]/section/div/div[3]/div[3]/table/tbody/tr/td[6]/div/button[1]/span/a')

# 使用arguments关键字删除“查看”按钮的target属性
driver.execute_script("arguments[0].removeAttribute('target')",a)

# 点击页面第一条信息的“查看”按钮；
a.click()

# 点击弹窗右上角的“X”。
driver.find_element(By.XPATH,'/html/body/div[2]/div/div[1]/button').click()
